const http = require('http')

http.createServer((req, res) => {
  console.log('res=')
  console.log(res)
  let body = []
  res.writeHead(200, {
    'Content-Type': 'text/plain;charset=utf-8'
  })
  req.on('data', (chunk) => {
    body.push(chunk)
  })
  req.on('end', () => {
    body = Buffer.concat(body)
    console.log(body.toString())
  })
  res.end('Hello Cwy!')
}).listen(8080)

console.log('服务已启动！')
